package com.wjq.message.listener;

import com.wjq.message.common.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
@RabbitListener(queues = "message")
public class MqListener {

    @RabbitHandler
    public void rabbitHandler(String message) throws IOException {
        System.err.println("进入rabbitHandler进行监听");

        String message1 = Message.message(message);
        System.out.println("返回信息："+message1);
    }

}
